import Taro from "@tarojs/taro";
import { IS_IOS } from "../utils/system";

const useStatusBar = () => {
  const systemRef = Taro.getSystemInfoSync()
  const barHeight = IS_IOS ? 44 : 48;
  const statusBarHeight = Taro.getSystemInfoSync().statusBarHeight
  const navHeight = barHeight + statusBarHeight

  return [
    statusBarHeight,
    navHeight,
    systemRef
  ] as [number, number, Taro.getSystemInfo.Result];
};

export default useStatusBar;
